#include "ZeroSetInstruction.h"

ZeroSetInstruction::ZeroSetInstruction(Function * func, Value * ptr, Type * arrayType)
    : Instruction(func, IRInstOperator::IRINST_OP_ZEROSET, VoidType::getType()), ptr_(ptr), arrayType_(arrayType)
{
    addOperand(ptr);
}

void ZeroSetInstruction::toString(std::string & str)
{
    std::string ptrType = ptr_ ? ptr_->getType()->toString() : "null";
    std::string ptrName = ptr_ ? ptr_->getIRName() : "null";

    str = "store " + arrayType_->toString() + " zeroinitializer, " + ptrType + "* " + ptrName;
}